<ion-view title="{{groupName}}">
    <ion-nav-buttons side="left">
        <button menu-toggle="left" class="button button-icon icon ion-navicon-round"></button>
    </ion-nav-buttons>
    <ion-nav-buttons side="right">
        <button class="button button-icon icon ion-plus-round" ng-click="add()"></button>
        <button class="button button-icon icon ion-more"
                ns-popover
                ns-popover-template="moreMenu"
                ns-popover-trigger="click"
                ns-popover-theme="ns-popover-list-theme"
                ns-popover-placement="bottom|right"
                ns-popover-timeout="2"></button>
    </ion-nav-buttons>
    <ion-content class="has-header">

        <div class="list" ng-show="!todolists.length && !todolists_finish.length">
            <div class="row">
                <div class="col col-offset-33">暂时还没有任务安排！</div>
            </div>
        </div>

        <div class="list" id="todolist" ng-show="todolists.length || todolists_finish.length">
            <div class="item item-divider" ng-show="todolists.length"> 进行中</div>
            <div class="item item-checkbox"
                 ng-repeat="todo in todolists"
                 ng-click="show({{todo.id}},{{todo.type}})"
                 ng-show="todolists.length">
                <label class="checkbox {{todo.classname}}" style="width:48px;"><input type="checkbox" ion-stop-event
                                                                                      ng-click="finish({{todo.id}}, $event);"></label>
                {{todo.title | limitTo:12}} <span class="badge">{{todo.date | displayDate}}</span>
            </div>
            <div class="item item-divider" ng-show="todolists_finish.length"> 已完成</div>
            <div class="item item-checkbox"
                 ng-repeat="todo in todolists_finish"
                 ng-click="show({{todo.id}},{{todo.type}})"
                 ng-show="todolists_finish.length">
                <label class="checkbox checkbox-stable" style="width:48px;"><input type="checkbox" checked
                                                                                   ion-stop-event
                                                                                   ng-click="finish({{todo.id}}, $event);"></label>
                {{todo.title | limitTo:12}} <span class="badge">{{todo.date | displayDate}}</span>
            </div>
            <div class="item" style="border-bottom-width:0;" ng-show="todolists_finish.length"></div>
        </div>
    </ion-content>
</ion-view>
<script type="text/ng-template" id="moreMenu">
    <div class="triangle"></div>
    <div class="ns-popover-tooltip" style="width:100px;">
        <div class="list" style="margin-top:0;margin-bottom:0;">
            <a class="item" ng-click="hidePopover();search();"> 搜索 </a>
            <a class="item" ng-click="hidePopover();sort();"> 排序 </a>
        </div>
    </div>
</script>